/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.database.impl;

import java.util.Collection;

import org.dengues.model.database.DBColumn;
import org.dengues.model.database.DBTable;
import org.dengues.model.database.DatabasePackage;
import org.dengues.model.database.ForeignKey;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>DB Column</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getTable <em>Table</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getType <em>Type</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getDefaultValue <em>Default Value</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#isKey <em>Key</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#isNullable <em>Nullable</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getLength <em>Length</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getPrecision <em>Precision</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getOutputs <em>Outputs</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#isOnlyRead <em>Only Read</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getInputs <em>Inputs</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getPattern <em>Pattern</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#isForeignKey <em>Foreign Key</em>}</li>
 *   <li>{@link org.dengues.model.database.impl.DBColumnImpl#getLinkName <em>Link Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DBColumnImpl extends DiagramChildImpl implements DBColumn {
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public static final String copyright = "// ============================================================================\r\n//\r\n// Copyright (C) 2006-2007 Dengues\r\n//\r\n// Google Group: http://groups.google.com/group/dengues\r\n// QQ Group: 24885404\r\n//\r\n// This library is free software; you can redistribute it and/or\r\n// modify it under the terms of the GNU Lesser General Public\r\n// License as published by the Free Software Foundation; either\r\n// version 2.1 of the License.\r\n//\r\n// This library is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n// Lesser General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU General Public License\r\n// along with this program; if not, write to the Free Software\r\n// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n//\r\n// ============================================================================\r\n";

    /**
     * The default value of the '{@link #getType() <em>Type</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getType()
     * @generated
     * @ordered
     */
    protected static final String TYPE_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getType()
     * @generated
     * @ordered
     */
    protected String type = TYPE_EDEFAULT;

    /**
     * The default value of the '{@link #getDefaultValue() <em>Default Value</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getDefaultValue()
     * @generated
     * @ordered
     */
    protected static final String DEFAULT_VALUE_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getDefaultValue() <em>Default Value</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getDefaultValue()
     * @generated
     * @ordered
     */
    protected String defaultValue = DEFAULT_VALUE_EDEFAULT;

    /**
     * The default value of the '{@link #isKey() <em>Key</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isKey()
     * @generated
     * @ordered
     */
    protected static final boolean KEY_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isKey() <em>Key</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isKey()
     * @generated
     * @ordered
     */
    protected boolean key = KEY_EDEFAULT;

    /**
     * The default value of the '{@link #isNullable() <em>Nullable</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isNullable()
     * @generated
     * @ordered
     */
    protected static final boolean NULLABLE_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isNullable() <em>Nullable</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isNullable()
     * @generated
     * @ordered
     */
    protected boolean nullable = NULLABLE_EDEFAULT;

    /**
     * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getLength()
     * @generated
     * @ordered
     */
    protected static final int LENGTH_EDEFAULT = -1;

    /**
     * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getLength()
     * @generated
     * @ordered
     */
    protected int length = LENGTH_EDEFAULT;

    /**
     * The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPrecision()
     * @generated
     * @ordered
     */
    protected static final int PRECISION_EDEFAULT = -1;

    /**
     * The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPrecision()
     * @generated
     * @ordered
     */
    protected int precision = PRECISION_EDEFAULT;

    /**
     * The cached value of the '{@link #getOutputs() <em>Outputs</em>}' reference list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getOutputs()
     * @generated
     * @ordered
     */
    protected EList<ForeignKey> outputs;

    /**
     * The default value of the '{@link #isOnlyRead() <em>Only Read</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isOnlyRead()
     * @generated
     * @ordered
     */
    protected static final boolean ONLY_READ_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isOnlyRead() <em>Only Read</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isOnlyRead()
     * @generated
     * @ordered
     */
    protected boolean onlyRead = ONLY_READ_EDEFAULT;

    /**
     * The cached value of the '{@link #getInputs() <em>Inputs</em>}' containment reference list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getInputs()
     * @generated
     * @ordered
     */
    protected EList<ForeignKey> inputs;

    /**
     * The default value of the '{@link #getPattern() <em>Pattern</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPattern()
     * @generated
     * @ordered
     */
    protected static final String PATTERN_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getPattern() <em>Pattern</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPattern()
     * @generated
     * @ordered
     */
    protected String pattern = PATTERN_EDEFAULT;

    /**
     * The default value of the '{@link #isForeignKey() <em>Foreign Key</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isForeignKey()
     * @generated
     * @ordered
     */
    protected static final boolean FOREIGN_KEY_EDEFAULT = false;

    /**
     * The cached value of the '{@link #isForeignKey() <em>Foreign Key</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #isForeignKey()
     * @generated
     * @ordered
     */
    protected boolean foreignKey = FOREIGN_KEY_EDEFAULT;

    /**
     * The default value of the '{@link #getLinkName() <em>Link Name</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getLinkName()
     * @generated
     * @ordered
     */
    protected static final String LINK_NAME_EDEFAULT = null;

    /**
     * The cached value of the '{@link #getLinkName() <em>Link Name</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getLinkName()
     * @generated
     * @ordered
     */
    protected String linkName = LINK_NAME_EDEFAULT;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected DBColumnImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return DatabasePackage.Literals.DB_COLUMN;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public DBTable getTable() {
        if (eContainerFeatureID != DatabasePackage.DB_COLUMN__TABLE) return null;
        return (DBTable)eContainer();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetTable(DBTable newTable, NotificationChain msgs) {
        msgs = eBasicSetContainer((InternalEObject)newTable, DatabasePackage.DB_COLUMN__TABLE, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setTable(DBTable newTable) {
        if (newTable != eInternalContainer() || (eContainerFeatureID != DatabasePackage.DB_COLUMN__TABLE && newTable != null)) {
            if (EcoreUtil.isAncestor(this, newTable))
                throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
            NotificationChain msgs = null;
            if (eInternalContainer() != null)
                msgs = eBasicRemoveFromContainer(msgs);
            if (newTable != null)
                msgs = ((InternalEObject)newTable).eInverseAdd(this, DatabasePackage.DB_TABLE__COLUMNS, DBTable.class, msgs);
            msgs = basicSetTable(newTable, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__TABLE, newTable, newTable));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getType() {
        return type;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setType(String newType) {
        String oldType = type;
        type = newType;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__TYPE, oldType, type));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getDefaultValue() {
        return defaultValue;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setDefaultValue(String newDefaultValue) {
        String oldDefaultValue = defaultValue;
        defaultValue = newDefaultValue;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__DEFAULT_VALUE, oldDefaultValue, defaultValue));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isKey() {
        return key;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setKey(boolean newKey) {
        boolean oldKey = key;
        key = newKey;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__KEY, oldKey, key));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isNullable() {
        return nullable;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setNullable(boolean newNullable) {
        boolean oldNullable = nullable;
        nullable = newNullable;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__NULLABLE, oldNullable, nullable));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getLength() {
        return length;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setLength(int newLength) {
        int oldLength = length;
        length = newLength;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__LENGTH, oldLength, length));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getPrecision() {
        return precision;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPrecision(int newPrecision) {
        int oldPrecision = precision;
        precision = newPrecision;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__PRECISION, oldPrecision, precision));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EList<ForeignKey> getOutputs() {
        if (outputs == null) {
            outputs = new EObjectWithInverseResolvingEList<ForeignKey>(ForeignKey.class, this, DatabasePackage.DB_COLUMN__OUTPUTS, DatabasePackage.FOREIGN_KEY__SOURCE);
        }
        return outputs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isOnlyRead() {
        return onlyRead;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setOnlyRead(boolean newOnlyRead) {
        boolean oldOnlyRead = onlyRead;
        onlyRead = newOnlyRead;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__ONLY_READ, oldOnlyRead, onlyRead));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EList<ForeignKey> getInputs() {
        if (inputs == null) {
            inputs = new EObjectContainmentWithInverseEList<ForeignKey>(ForeignKey.class, this, DatabasePackage.DB_COLUMN__INPUTS, DatabasePackage.FOREIGN_KEY__TARGET);
        }
        return inputs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getPattern() {
        return pattern;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPattern(String newPattern) {
        String oldPattern = pattern;
        pattern = newPattern;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__PATTERN, oldPattern, pattern));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public boolean isForeignKey() {
        return foreignKey;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setForeignKey(boolean newForeignKey) {
        boolean oldForeignKey = foreignKey;
        foreignKey = newForeignKey;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__FOREIGN_KEY, oldForeignKey, foreignKey));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getLinkName() {
        return linkName;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setLinkName(String newLinkName) {
        String oldLinkName = linkName;
        linkName = newLinkName;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, DatabasePackage.DB_COLUMN__LINK_NAME, oldLinkName, linkName));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                if (eInternalContainer() != null)
                    msgs = eBasicRemoveFromContainer(msgs);
                return basicSetTable((DBTable)otherEnd, msgs);
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                return ((InternalEList<InternalEObject>)(InternalEList<?>)getOutputs()).basicAdd(otherEnd, msgs);
            case DatabasePackage.DB_COLUMN__INPUTS:
                return ((InternalEList<InternalEObject>)(InternalEList<?>)getInputs()).basicAdd(otherEnd, msgs);
        }
        return super.eInverseAdd(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                return basicSetTable(null, msgs);
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                return ((InternalEList<?>)getOutputs()).basicRemove(otherEnd, msgs);
            case DatabasePackage.DB_COLUMN__INPUTS:
                return ((InternalEList<?>)getInputs()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
        switch (eContainerFeatureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                return eInternalContainer().eInverseRemove(this, DatabasePackage.DB_TABLE__COLUMNS, DBTable.class, msgs);
        }
        return super.eBasicRemoveFromContainerFeature(msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                return getTable();
            case DatabasePackage.DB_COLUMN__TYPE:
                return getType();
            case DatabasePackage.DB_COLUMN__DEFAULT_VALUE:
                return getDefaultValue();
            case DatabasePackage.DB_COLUMN__KEY:
                return isKey() ? Boolean.TRUE : Boolean.FALSE;
            case DatabasePackage.DB_COLUMN__NULLABLE:
                return isNullable() ? Boolean.TRUE : Boolean.FALSE;
            case DatabasePackage.DB_COLUMN__LENGTH:
                return new Integer(getLength());
            case DatabasePackage.DB_COLUMN__PRECISION:
                return new Integer(getPrecision());
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                return getOutputs();
            case DatabasePackage.DB_COLUMN__ONLY_READ:
                return isOnlyRead() ? Boolean.TRUE : Boolean.FALSE;
            case DatabasePackage.DB_COLUMN__INPUTS:
                return getInputs();
            case DatabasePackage.DB_COLUMN__PATTERN:
                return getPattern();
            case DatabasePackage.DB_COLUMN__FOREIGN_KEY:
                return isForeignKey() ? Boolean.TRUE : Boolean.FALSE;
            case DatabasePackage.DB_COLUMN__LINK_NAME:
                return getLinkName();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                setTable((DBTable)newValue);
                return;
            case DatabasePackage.DB_COLUMN__TYPE:
                setType((String)newValue);
                return;
            case DatabasePackage.DB_COLUMN__DEFAULT_VALUE:
                setDefaultValue((String)newValue);
                return;
            case DatabasePackage.DB_COLUMN__KEY:
                setKey(((Boolean)newValue).booleanValue());
                return;
            case DatabasePackage.DB_COLUMN__NULLABLE:
                setNullable(((Boolean)newValue).booleanValue());
                return;
            case DatabasePackage.DB_COLUMN__LENGTH:
                setLength(((Integer)newValue).intValue());
                return;
            case DatabasePackage.DB_COLUMN__PRECISION:
                setPrecision(((Integer)newValue).intValue());
                return;
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                getOutputs().clear();
                getOutputs().addAll((Collection<? extends ForeignKey>)newValue);
                return;
            case DatabasePackage.DB_COLUMN__ONLY_READ:
                setOnlyRead(((Boolean)newValue).booleanValue());
                return;
            case DatabasePackage.DB_COLUMN__INPUTS:
                getInputs().clear();
                getInputs().addAll((Collection<? extends ForeignKey>)newValue);
                return;
            case DatabasePackage.DB_COLUMN__PATTERN:
                setPattern((String)newValue);
                return;
            case DatabasePackage.DB_COLUMN__FOREIGN_KEY:
                setForeignKey(((Boolean)newValue).booleanValue());
                return;
            case DatabasePackage.DB_COLUMN__LINK_NAME:
                setLinkName((String)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                setTable((DBTable)null);
                return;
            case DatabasePackage.DB_COLUMN__TYPE:
                setType(TYPE_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__DEFAULT_VALUE:
                setDefaultValue(DEFAULT_VALUE_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__KEY:
                setKey(KEY_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__NULLABLE:
                setNullable(NULLABLE_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__LENGTH:
                setLength(LENGTH_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__PRECISION:
                setPrecision(PRECISION_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                getOutputs().clear();
                return;
            case DatabasePackage.DB_COLUMN__ONLY_READ:
                setOnlyRead(ONLY_READ_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__INPUTS:
                getInputs().clear();
                return;
            case DatabasePackage.DB_COLUMN__PATTERN:
                setPattern(PATTERN_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__FOREIGN_KEY:
                setForeignKey(FOREIGN_KEY_EDEFAULT);
                return;
            case DatabasePackage.DB_COLUMN__LINK_NAME:
                setLinkName(LINK_NAME_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case DatabasePackage.DB_COLUMN__TABLE:
                return getTable() != null;
            case DatabasePackage.DB_COLUMN__TYPE:
                return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
            case DatabasePackage.DB_COLUMN__DEFAULT_VALUE:
                return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue);
            case DatabasePackage.DB_COLUMN__KEY:
                return key != KEY_EDEFAULT;
            case DatabasePackage.DB_COLUMN__NULLABLE:
                return nullable != NULLABLE_EDEFAULT;
            case DatabasePackage.DB_COLUMN__LENGTH:
                return length != LENGTH_EDEFAULT;
            case DatabasePackage.DB_COLUMN__PRECISION:
                return precision != PRECISION_EDEFAULT;
            case DatabasePackage.DB_COLUMN__OUTPUTS:
                return outputs != null && !outputs.isEmpty();
            case DatabasePackage.DB_COLUMN__ONLY_READ:
                return onlyRead != ONLY_READ_EDEFAULT;
            case DatabasePackage.DB_COLUMN__INPUTS:
                return inputs != null && !inputs.isEmpty();
            case DatabasePackage.DB_COLUMN__PATTERN:
                return PATTERN_EDEFAULT == null ? pattern != null : !PATTERN_EDEFAULT.equals(pattern);
            case DatabasePackage.DB_COLUMN__FOREIGN_KEY:
                return foreignKey != FOREIGN_KEY_EDEFAULT;
            case DatabasePackage.DB_COLUMN__LINK_NAME:
                return LINK_NAME_EDEFAULT == null ? linkName != null : !LINK_NAME_EDEFAULT.equals(linkName);
        }
        return super.eIsSet(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
        result.append(" (type: ");
        result.append(type);
        result.append(", defaultValue: ");
        result.append(defaultValue);
        result.append(", key: ");
        result.append(key);
        result.append(", nullable: ");
        result.append(nullable);
        result.append(", length: ");
        result.append(length);
        result.append(", precision: ");
        result.append(precision);
        result.append(", onlyRead: ");
        result.append(onlyRead);
        result.append(", pattern: ");
        result.append(pattern);
        result.append(", foreignKey: ");
        result.append(foreignKey);
        result.append(", linkName: ");
        result.append(linkName);
        result.append(')');
        return result.toString();
    }

} //DBColumnImpl
